// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_k;

import java.io.File;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;

// Referenced classes of package com.nnee.k:
//            e, a, d

public class cls_b
    implements Runnable
{

    public cls_b(cls_e e1)
    {
        this(e1, 0x14997000L);
    }

    public cls_b(cls_e e1, long l)
    {super();
        d = e1;
        
        c = l;
    }

    public cls_b(cls_e e1, long l, boolean flag)
    {super();
        d = e1;
        
        c = l;
        b = flag;
    }

    public void a()
    {
        a = true;
    }

    public void run()
    {
        long l;
        int i;
        File file;
        l = 0L;
        i = 0;
        file = new File(cls_e.a(d));
        if(!file.exists()) {
        	 cls_e.a(d, this);
             return;
        }else {
        	String as[] = file.list();
            if(as == null || as.length <= 0) {
        	 cls_e.a(d, this);
             return;
            } else {
            	int j = as.length;
                if(!b || c <= l) {
                	cls_d ad[] = new cls_d[j];
                    for(int k = i; k < ad.length; k++)
                    {
                        File file1 = new File(file, as[k]);
                        ad[k] = new cls_d(as[k], file1.lastModified());
                    }

                    Arrays.sort(ad);
                    int i1 = i;
                    do
                    {
                        if(!a && i < j)
                        {
            
                            {
                                File file2 = new File(file, ad[i].a);
                                i1++;
                                l += file2.length();
                                if(file2.exists())
                                {
                                    c = file2.lastModified();
                                    d.b(file2);
                                }
                                if(cls_e.b(d).get() << 1 > cls_e.c(d))
                                    break  ;
                                if(d.a != null)
                                    d.a.b(cls_e.a(d), l, c);
                            }
                        }
                        if(true)
                            continue;
                        ad[i] = null;
                        i++;
                    } while(true);
                    
                    cls_e.a(d, this);
                    return;
                } else {
                	int j1 = i;
                    while(!a && i < j) 
                    {
                        File file3 = new File(file, as[i]);
                        if(file3.lastModified() <= c)
                        {
                            j1++;
                            l += file3.length();
                            if(file3.exists())
                                d.b(file3);
                            as[i] = null;
                        }
                        i++;
                    }
                    if(d.a != null)
                        d.a.b(cls_e.a(d), l, c);
                    cls_e.a(d, this);
                    return;
                }
            }
        }
 
    }

    boolean a;
    boolean b;
    long c;
    final cls_e d;
}
